#include <iostream>
using std::cout;
using std::endl;

class Base{
public:
    Base(int data)
    :_data(data)
    {

    }
    friend Base operator+(const Base & lhs, const Base & rhs);
    friend int operator==(const Base & lhs, int data);
private:
    int _data;
};

Base operator+(const Base & lhs, const Base & rhs){
    return Base(lhs._data + rhs._data);
}
int operator==(const Base & lhs, int data){
    if(lhs._data == data){
        return 0;
    }
    return 1;
}
//要求：实现以下代码执行后输出1
void test(){
    int i=2;
    int j=7;

    Base x(i);
    Base y(j);
    cout << (x+y == j-i) <<endl; 
}

int main()
{
    test ();
    return 0;
}

